Skip to content

Conversation

@35C4n0r
Copy link
Collaborator

@35C4n0r 35C4n0r commented Nov 12, 2025

Example - Opencode agent:

running -> stable (we send initial prompt on first stable) -> running (this is the part where it finally shows the splash screen and the agent is ready to accept input).

The PR tries to fix this by taking into account whether the input box is visible or not.

@35C4n0r 35C4n0r self-assigned this Nov 12, 2025
@35C4n0r 35C4n0r marked this pull request as draft November 12, 2025 03:42
@35C4n0r 35C4n0r marked this pull request as ready for review November 12, 2025 13:25
@github-actions
Copy link

✅ Preview binaries are ready!

To test with modules: agentapi_version = "agentapi_142" or download from: https://github.com/coder/agentapi/releases/tag/agentapi_142

@35C4n0r 35C4n0r requested review from johnstcn and matifali November 12, 2025 13:48
Copy link
Collaborator

@hugodutka hugodutka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test in conversation_test.go to check if the new logic behaves correctly.

@35C4n0r
Copy link
Collaborator Author

35C4n0r commented Nov 18, 2025

resolved all the comments.

@35C4n0r 35C4n0r requested a review from mafredri November 21, 2025 16:42
@35C4n0r
Copy link
Collaborator Author

35C4n0r commented Nov 21, 2025

@mafredri resolved all the comments.

assert.Equal(t, st.ConversationStatusStable, c.Status())
assert.False(t, c.ReadyForInitialPrompt)
assert.True(t, c.InitialPromptSent)
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to see one more test case where we test that initial prompt is false, goes to true, and then back to false after the initial prompt is actually sent.

It'd be fine to update one of the tests to be that but perhaps it's not easily tested.

I'll leave it up to you though.

}
c := st.NewConversation(context.Background(), cfg, "initial prompt here")
// Manually mark as sent to simulate that initial prompt was already sent
c.InitialPromptSent = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to not do this manually? It's hard to say here whether we're testing that ready for initial prompt stays false the whole time or goes from true to false. I'm assuming it's the former but the latter has merit as a test. (See other comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants